﻿using System;
using System.Collections.Generic;
using System.Text;

namespace System
{
    public class ConsoleHelper
    {

        private static object asynclocker = new object();

        public static void WriteLine(string info, ConsoleColor color)
        {
            lock (asynclocker)
            {
                var oldcolor = Console.ForegroundColor;
                Console.ForegroundColor = color;
                Console.WriteLine(info);
                Console.ForegroundColor = oldcolor;
            }

        }

        public static void Danger(string info)
        {
            WriteLine(info, ConsoleColor.Red);
        }
        public static void Warnning(string info)
        {
            WriteLine(info, ConsoleColor.Yellow);
        }
        public static void Success(string info)
        {
            WriteLine(info, ConsoleColor.Green);
        }
        public static void Info(string info)
        {
            WriteLine(info, ConsoleColor.DarkCyan);
        }
    }
}
